using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace Converters
{
	public class FontWeightConverter : IValueConverter
	{
		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			if (value != null && value != DependencyProperty.UnsetValue && value is bool)
			{
				return ((bool)value) ? FontWeights.Bold : FontWeights.Normal;
			}
			return FontWeights.Normal;
		}

		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			return value;
		}
	}
}
